package com.ruoyi.risk.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.db.mapper.RiskConfigFilterInfoMapper;
import com.ruoyi.db.domain.RiskConfigFilterInfo;
import com.ruoyi.risk.service.IRiskConfigFilterInfoService;
import com.ruoyi.common.core.text.Convert;

/**
 * 风控条件过滤配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-07-25
 */
@Service
@DataSource(DataSourceType.SLAVE)
public class RiskConfigFilterInfoServiceImpl implements IRiskConfigFilterInfoService 
{
    @Autowired
    private RiskConfigFilterInfoMapper riskConfigFilterInfoMapper;

    /**
     * 查询风控条件过滤配置
     * 
     * @param id 风控条件过滤配置主键
     * @return 风控条件过滤配置
     */
    @Override
    public RiskConfigFilterInfo selectRiskConfigFilterInfoById(Long id)
    {
        return riskConfigFilterInfoMapper.selectRiskConfigFilterInfoById(id);
    }

    /**
     * 查询风控条件过滤配置列表
     * 
     * @param riskConfigFilterInfo 风控条件过滤配置
     * @return 风控条件过滤配置
     */
    @Override
    public List<RiskConfigFilterInfo> selectRiskConfigFilterInfoList(RiskConfigFilterInfo riskConfigFilterInfo)
    {
        return riskConfigFilterInfoMapper.selectRiskConfigFilterInfoList(riskConfigFilterInfo);
    }

    /**
     * 查询风控条件过滤配置列表
     *
     * @param riskConfigFilterInfo 风控条件过滤配置
     * @return 风控条件过滤配置
     */
    @Override
    public List<Map<String, Object>> selectRiskConfigFilterInfoListMap(RiskConfigFilterInfo riskConfigFilterInfo)
    {
        return riskConfigFilterInfoMapper.selectRiskConfigFilterInfoListMap(riskConfigFilterInfo);
    }

    /**
     * 新增风控条件过滤配置
     * 
     * @param riskConfigFilterInfo 风控条件过滤配置
     * @return 结果
     */
    @Override
    public int insertRiskConfigFilterInfo(RiskConfigFilterInfo riskConfigFilterInfo)
    {
        riskConfigFilterInfo.setCreateTime(DateUtils.getNowDate());
        return riskConfigFilterInfoMapper.insertRiskConfigFilterInfo(riskConfigFilterInfo);
    }

    /**
     * 修改风控条件过滤配置
     * 
     * @param riskConfigFilterInfo 风控条件过滤配置
     * @return 结果
     */
    @Override
    public int updateRiskConfigFilterInfo(RiskConfigFilterInfo riskConfigFilterInfo)
    {
        riskConfigFilterInfo.setUpdateTime(DateUtils.getNowDate());
        return riskConfigFilterInfoMapper.updateRiskConfigFilterInfo(riskConfigFilterInfo);
    }

    /**
     * 批量删除风控条件过滤配置
     * 
     * @param ids 需要删除的风控条件过滤配置主键
     * @return 结果
     */
    @Override
    public int deleteRiskConfigFilterInfoByIds(String ids)
    {
        return riskConfigFilterInfoMapper.deleteRiskConfigFilterInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除风控条件过滤配置信息
     * 
     * @param id 风控条件过滤配置主键
     * @return 结果
     */
    @Override
    public int deleteRiskConfigFilterInfoById(Long id)
    {
        return riskConfigFilterInfoMapper.deleteRiskConfigFilterInfoById(id);
    }
}
